import request from '@/config/axios'

// 用户合同 VO
export interface UserContractVO {
  id: number // 主键id
  contractData: string // 合同内容
  userId: number // 用户id
  contractTitle: string // 合同标题
  agreement: string // 协议
}

// 用户合同 API
export const UserContractApi = {
  // 查询用户合同分页
  getUserContractPage: async (params: any) => {
    return await request.get({ url: `/system/user-contract/page`, params })
  },

  // 查询用户合同详情
  getUserContract: async (id: number) => {
    return await request.get({ url: `/system/user-contract/get?id=` + id })
  },

  // 新增用户合同
  createUserContract: async (data: UserContractVO) => {
    return await request.post({ url: `/system/user-contract/create`, data })
  },

  // 修改用户合同
  updateUserContract: async (data: UserContractVO) => {
    return await request.put({ url: `/system/user-contract/update`, data })
  },

  // 删除用户合同
  deleteUserContract: async (id: number) => {
    return await request.delete({ url: `/system/user-contract/delete?id=` + id })
  },

  // 导出用户合同 Excel
  exportUserContract: async (params) => {
    return await request.download({ url: `/system/user-contract/export-excel`, params })
  },
}